import Cart from '@/views/cart.vue'
import Classif from '@/views/classif.vue'
import Detail from '@/views/detail.vue'
import Goods from '@/views/goods.vue'
import Home from '@/views/home.vue'
import Index from '@/views/index.vue'
import Login from '@/views/login.vue'
import My from '@/views/my.vue'
import Order from '@/views/order.vue'
import Register from '@/views/register.vue'
import Search from '@/views/search.vue'
import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/register',
      component: Register,
    },
    {
      path: '/login',
      component: Login,
    },
    {
      path: '/search',
      component: Search,
    },
    {
      path: '/detail/:goods_id',
      component: Detail,
    },
    {
      path: '/goods/:cat_id',
      component:Goods,
    },
    {
      path: '/order/:orderId',
      component:Order,
    },
    {
      path: '/index',
      component: Index,
      children:[
        {
          path: 'home',
          component: Home ,
        },
        {
          path: 'classif',
          component: Classif ,
        },
        {
          path: 'cart',
          component: Cart ,
        },
        {
          path: 'my',
          component: My ,
        },
      ]
    },
  ],
})

export default router
